import provinces from '../provinces'
import cities from '../cities'

export function zmGetProvincesArr() {
  const provinceArr = []
  provinces.forEach(function(item) {
    const obj = {}
    obj.name = item.name
    obj.code = item.code
    provinceArr.push(obj)
  })
  return provinceArr
}

export function zmGetCitiesArr(provinceCode) {
  // console.log("省：" + provinceCode)
  if (!provinceCode) {
    provinceCode = '11'
  }
  const cityArr = []
  cities.forEach(function(item) {
    if (item.provinceCode === provinceCode) {
      const obj = {}
      obj.name = item.name
      obj.code = item.code
      obj.provinceCode = item.provinceCode
      cityArr.push(obj)
    }
  })
  return cityArr
}

